using System;
using UnionAssets.FLE;
using UnityEngine;

public class IOSSocialManager : EventDispatcher
{
	public const string TWITTER_POST_FAILED = "twitter_post_failed";

	public const string TWITTER_POST_SUCCESS = "twitter_post_success";

	public const string FACEBOOK_POST_FAILED = "facebook_post_failed";

	public const string FACEBOOK_POST_SUCCESS = "facebook_post_success";

	public const string MAIL_FAILED = "mail_failed";

	public const string MAIL_SUCCESS = "mail_success";

	private static IOSSocialManager _instance;

	public Action<ISN_Result> OnFacebookPostResult;

	public Action<ISN_Result> OnTwitterPostResult;

	public Action<ISN_Result> OnMailResult;

	public static IOSSocialManager instance
	{
		get
		{
			if (_instance == null)
			{
				GameObject gameObject = new GameObject("IOSSocialManager");
				_instance = gameObject.AddComponent<IOSSocialManager>();
			}
			return _instance;
		}
	}

	private void Awake()
	{
		UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
	}

	public void ShareMedia(string text)
	{
		ShareMedia(text, null);
	}

	public void ShareMedia(string text, Texture2D texture)
	{
	}

	public void TwitterPost(string text)
	{
		TwitterPost(text, null);
	}

	public void TwitterPost(string text, Texture2D texture)
	{
		if (!(texture == null))
		{
		}
	}

	public void FacebookPost(string text)
	{
		FacebookPost(text, null);
	}

	public void FacebookPost(string text, Texture2D texture)
	{
		if (!(texture == null))
		{
		}
	}

	public void SendMail(string subject, string body, string recipients)
	{
		SendMail(subject, body, recipients, null);
	}

	public void SendMail(string subject, string body, string recipients, Texture2D texture)
	{
		if (!(texture == null))
		{
		}
	}

	private void OnTwitterPostFailed()
	{
		dispatch("twitter_post_failed");
		if (OnTwitterPostResult != null)
		{
			ISN_Result obj = new ISN_Result(false);
			OnTwitterPostResult(obj);
		}
	}

	private void OnTwitterPostSuccess()
	{
		dispatch("twitter_post_success");
		if (OnTwitterPostResult != null)
		{
			ISN_Result obj = new ISN_Result(true);
			OnTwitterPostResult(obj);
		}
	}

	private void OnFacebookPostFailed()
	{
		dispatch("facebook_post_failed");
		if (OnFacebookPostResult != null)
		{
			ISN_Result obj = new ISN_Result(false);
			OnFacebookPostResult(obj);
		}
	}

	private void OnFacebookPostSuccess()
	{
		dispatch("facebook_post_success");
		if (OnFacebookPostResult != null)
		{
			ISN_Result obj = new ISN_Result(true);
			OnFacebookPostResult(obj);
		}
	}

	private void OnMailFailed()
	{
		dispatch("mail_failed");
		if (OnMailResult != null)
		{
			ISN_Result obj = new ISN_Result(false);
			OnMailResult(obj);
		}
	}

	private void OnMailSuccess()
	{
		dispatch("mail_success");
		if (OnMailResult != null)
		{
			ISN_Result obj = new ISN_Result(true);
			OnMailResult(obj);
		}
	}
}
